xen/arm: vgic-v3: Don't create empty re-distributor regions
authorJulien Grall <julien.grall@arm.com>
Mon, 1 Oct 2018 16:42:27 +0000 (17:42 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Mon, 28 Jan 2019 21:46:32 +0000 (13:46 -0800)
commit14b7dc115b8a5d90cf842ac003100542408f671c
tree9aab4d0d48610e241a95b760ac8b769704218429
parent015b00ff3581d5f83cbc0ea96ebdc3900f12053e
xen/arm: vgic-v3: Don't create empty re-distributor regions

At the moment, Xen is assuming the hardware domain will have the same
number of re-distributor regions as the host. However, as the
number of CPUs or the stride (e.g on GICv4) may be different we end up
exposing regions which does not contain any re-distributors.

When booting, Linux will go through all the re-distributor region to
check whether a property (e.g vPLIs) is available accross all the
re-distributors. This will result to a data abort on empty regions
because there are no underlying re-distributor.

So we need to limit the number of regions exposed to the hardware
domain. The code reworked to only expose the minimun number of regions
required by the hardware domain. It is assumed the regions will be
populated starting from the first one.

Lastly, rename vgic_v3_rdist_count to reflect the value return by the
helper.

Reported-by: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
Signed-off-by: Julien Grall <julien.grall@arm.com>
Tested-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
(cherry picked from commit 54ec59f6b0b363c34cf1864d5214a05e35ea75ee)
xen/arch/arm/gic-v3.c
xen/arch/arm/vgic-v3.c